package cn.rkylin.oms.warehouse.returnStockin.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.warehouse.returnStockin.vo.ReturnStockinSkuVO;

/**
 * 退货入库单商品DAO
 * 
 * @author 齐涛
 * @version 1.0
 * @created 28-9-2017 10:51:30
 */
@Repository(value = "returnStockinSkuDAO")
public class ReturnStockinSkuDAOImpl implements ReturnStockinSkuDAO {

    private String SELECT_RETURN_STOCK_IN_SKU_BY_SOURCE_ID = "selectFactReturnStockinSkuBySourceId";
    private String SELECT_PLAN_RETURN_STOCK_IN_SKU_BY_SOURCE_ID = "selectPlanReturnStockinSkuBySourceId";

    @Autowired
    protected IDataBaseFactory dao;

    /**
     * 退货入库单商品列表
     * 
     * @param returnStockinSkuVO
     *            退货入库单商品VO
     * @return 退货入库单商品列表
     * @throws Exception
     *             异常
     */
    public List<ReturnStockinSkuVO> selectReturnStockinSkuList(ReturnStockinSkuVO returnStockinSkuVO) throws Exception {
        return dao.findAllList("selectReturnStockinSkuList", returnStockinSkuVO);

    }

    @Override
    public List<ReturnStockinSkuVO> selectFactReturnStockinSkuBySourceId(String returnId) throws Exception{
        return dao.find(SELECT_RETURN_STOCK_IN_SKU_BY_SOURCE_ID, returnId);
    }
    
    @Override
    public List<ReturnStockinSkuVO> selectPlanReturnStockinSkuBySourceId(String returnId) throws Exception{
        return dao.find(SELECT_PLAN_RETURN_STOCK_IN_SKU_BY_SOURCE_ID, returnId);
    }

}
